using System;
using System.Collections.Generic;
using UnityEngine;

namespace MaterialUI
{
	[ExecuteInEditMode]
	public class TweenManager : MonoBehaviour
	{
		[Serializable]
		private class TweenQueue<T> where T : AutoTween, new()
		{
			[SerializeField]
			private Queue<T> m_Tweens = new Queue<T>();

			[SerializeField]
			public Queue<T> tweens => m_Tweens;

			[SerializeField]
			public T GetTween()
			{
				return (m_Tweens.Count <= 0) ? new T() : m_Tweens.Dequeue();
			}
		}

		[SerializeField]
		private static TweenManager m_Instance;

		private bool m_ReadyToKill;

		[SerializeField]
		private List<AutoTween> m_ActiveTweens = new List<AutoTween>();

		private int m_TweenIdCount = 1;

		private bool m_FirstFrame = true;

		[SerializeField]
		private TweenQueue<AutoTweenFloat> m_TweenFloatQueue = new TweenQueue<AutoTweenFloat>();

		[SerializeField]
		private TweenQueue<AutoTweenInt> m_TweenIntQueue = new TweenQueue<AutoTweenInt>();

		[SerializeField]
		private TweenQueue<AutoTweenVector2> m_TweenVector2Queue = new TweenQueue<AutoTweenVector2>();

		[SerializeField]
		private TweenQueue<AutoTweenVector3> m_TweenVector3Queue = new TweenQueue<AutoTweenVector3>();

		[SerializeField]
		private TweenQueue<AutoTweenVector4> m_TweenVector4Queue = new TweenQueue<AutoTweenVector4>();

		[SerializeField]
		private TweenQueue<AutoTweenColor> m_TweenColorQueue = new TweenQueue<AutoTweenColor>();

		private static TweenManager instance
		{
			get
			{
				if (m_Instance == null)
				{
					m_Instance = new GameObject("Tween Manager").AddComponent<TweenManager>();
				}
				return m_Instance;
			}
		}

		public int totalTweenCount => activeTweenCount + dormantTweenCount;

		public int activeTweenCount => m_ActiveTweens.Count;

		public int dormantTweenCount
		{
			get
			{
				int num = 0;
				num += m_TweenIntQueue.tweens.Count;
				num += m_TweenFloatQueue.tweens.Count;
				num += m_TweenVector2Queue.tweens.Count;
				num += m_TweenVector3Queue.tweens.Count;
				num += m_TweenVector4Queue.tweens.Count;
				return num + m_TweenColorQueue.tweens.Count;
			}
		}

		public void OnApplicationQuit()
		{
			m_ReadyToKill = true;
		}

		private void Update()
		{
			if (m_FirstFrame)
			{
				m_FirstFrame = false;
				return;
			}
			for (int i = 0; i < m_ActiveTweens.Count; i++)
			{
				m_ActiveTweens[i].UpdateTween();
			}
			if (m_ReadyToKill)
			{
				UnityEngine.Object.Destroy(base.gameObject);
			}
		}

		public static void Release(AutoTween tween)
		{
			instance.m_ActiveTweens.Remove(tween);
			if (tween.GetType() == typeof(AutoTweenFloat))
			{
				instance.m_TweenFloatQueue.tweens.Enqueue((AutoTweenFloat)tween);
			}
		}

		public static bool TweenIsActive(int id)
		{
			for (int i = 0; i < instance.m_ActiveTweens.Count; i++)
			{
				if (instance.m_ActiveTweens[i].tweenId == id)
				{
					return true;
				}
			}
			return false;
		}

		public static void EndTween(int id, bool callCallback = false)
		{
			for (int i = 0; i < instance.m_ActiveTweens.Count; i++)
			{
				AutoTween autoTween = instance.m_ActiveTweens[i];
				if (autoTween.tweenId == id)
				{
					autoTween.EndTween(callCallback);
				}
			}
		}

		public static int TweenValue<T>(Action<T> updateValue, T startValue, T targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenValue(updateValue, () => startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenValue<T>(Action<T> updateValue, Func<T> startValue, T targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenValue(updateValue, startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenValue<T>(Action<T> updateValue, Func<T> startValue, Func<T> targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			if (typeof(T) == typeof(float))
			{
				return TweenFloat(updateValue as Action<float>, startValue as Func<float>, targetValue as Func<float>, duration, delay, callback, scaledTime, tweenType);
			}
			if (typeof(T) == typeof(int))
			{
				return TweenInt(updateValue as Action<int>, startValue as Func<int>, targetValue as Func<int>, duration, delay, callback, scaledTime, tweenType);
			}
			if (typeof(T) == typeof(Vector2))
			{
				return TweenVector2(updateValue as Action<Vector2>, startValue as Func<Vector2>, targetValue as Func<Vector2>, duration, delay, callback, scaledTime, tweenType);
			}
			if (typeof(T) == typeof(Vector3))
			{
				return TweenVector3(updateValue as Action<Vector3>, startValue as Func<Vector3>, targetValue as Func<Vector3>, duration, delay, callback, scaledTime, tweenType);
			}
			if (typeof(T) == typeof(Vector4))
			{
				return TweenVector4(updateValue as Action<Vector4>, startValue as Func<Vector4>, targetValue as Func<Vector4>, duration, delay, callback, scaledTime, tweenType);
			}
			if (typeof(T) == typeof(Color))
			{
				return TweenColor(updateValue as Action<Color>, startValue as Func<Color>, targetValue as Func<Color>, duration, delay, callback, scaledTime, tweenType);
			}
			UnityEngine.Debug.LogWarning("Value type not supported for tweening");
			return 0;
		}

		public static int TweenTweenValueCustom<T>(Action<T> updateValue, T startValue, T targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenValueCustom(updateValue, () => startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenValueCustom<T>(Action<T> updateValue, Func<T> startValue, T targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenValueCustom(updateValue, startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenValueCustom<T>(Action<T> updateValue, Func<T> startValue, Func<T> targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			if (typeof(T) == typeof(float))
			{
				return TweenFloatCustom(updateValue as Action<float>, startValue as Func<float>, targetValue as Func<float>, duration, animationCurve, delay, callback, scaledTime);
			}
			if (typeof(T) == typeof(int))
			{
				return TweenIntCustom(updateValue as Action<int>, startValue as Func<int>, targetValue as Func<int>, duration, animationCurve, delay, callback, scaledTime);
			}
			if (typeof(T) == typeof(Vector2))
			{
				return TweenVector2Custom(updateValue as Action<Vector2>, startValue as Func<Vector2>, targetValue as Func<Vector2>, duration, animationCurve, delay, callback, scaledTime);
			}
			if (typeof(T) == typeof(Vector3))
			{
				return TweenVector3Custom(updateValue as Action<Vector3>, startValue as Func<Vector3>, targetValue as Func<Vector3>, duration, animationCurve, delay, callback, scaledTime);
			}
			if (typeof(T) == typeof(Vector4))
			{
				return TweenVector4Custom(updateValue as Action<Vector4>, startValue as Func<Vector4>, targetValue as Func<Vector4>, duration, animationCurve, delay, callback, scaledTime);
			}
			if (typeof(T) == typeof(Color))
			{
				return TweenColorCustom(updateValue as Action<Color>, startValue as Func<Color>, targetValue as Func<Color>, duration, animationCurve, delay, callback, scaledTime);
			}
			UnityEngine.Debug.LogWarning("Value type not supported for tweening");
			return 0;
		}

		public static int TweenFloat(Action<float> updateValue, float startValue, float targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenFloat(updateValue, () => startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenFloat(Action<float> updateValue, Func<float> startValue, float targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenFloat(updateValue, startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenFloat(Action<float> updateValue, Func<float> startValue, Func<float> targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			AutoTweenFloat tween = instance.m_TweenFloatQueue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, tweenType, callback, null, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenFloatCustom(Action<float> updateValue, float startValue, float targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenFloatCustom(updateValue, () => startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenFloatCustom(Action<float> updateValue, Func<float> startValue, float targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenFloatCustom(updateValue, startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenFloatCustom(Action<float> updateValue, Func<float> startValue, Func<float> targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			AutoTweenFloat tween = instance.m_TweenFloatQueue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, Tween.TweenType.Custom, callback, animationCurve, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenInt(Action<int> updateValue, int startValue, int targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenInt(updateValue, () => startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenInt(Action<int> updateValue, Func<int> startValue, int targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenInt(updateValue, startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenInt(Action<int> updateValue, Func<int> startValue, Func<int> targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			AutoTweenInt tween = instance.m_TweenIntQueue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, tweenType, callback, null, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenIntCustom(Action<int> updateValue, int startValue, int targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenIntCustom(updateValue, () => startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenIntCustom(Action<int> updateValue, Func<int> startValue, int targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenIntCustom(updateValue, startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenIntCustom(Action<int> updateValue, Func<int> startValue, Func<int> targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			AutoTweenInt tween = instance.m_TweenIntQueue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, Tween.TweenType.Custom, callback, animationCurve, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenVector2(Action<Vector2> updateValue, Vector2 startValue, Vector2 targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenVector2(updateValue, () => startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenVector2(Action<Vector2> updateValue, Func<Vector2> startValue, Vector2 targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenVector2(updateValue, startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenVector2(Action<Vector2> updateValue, Func<Vector2> startValue, Func<Vector2> targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			AutoTweenVector2 tween = instance.m_TweenVector2Queue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, tweenType, callback, null, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenVector2Custom(Action<Vector2> updateValue, Vector2 startValue, Vector2 targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenVector2Custom(updateValue, () => startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenVector2Custom(Action<Vector2> updateValue, Func<Vector2> startValue, Vector2 targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenVector2Custom(updateValue, startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenVector2Custom(Action<Vector2> updateValue, Func<Vector2> startValue, Func<Vector2> targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			AutoTweenVector2 tween = instance.m_TweenVector2Queue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, Tween.TweenType.Custom, callback, animationCurve, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenVector3(Action<Vector3> updateValue, Vector3 startValue, Vector3 targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenVector3(updateValue, () => startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenVector3(Action<Vector3> updateValue, Func<Vector3> startValue, Vector3 targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenVector3(updateValue, startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenVector3(Action<Vector3> updateValue, Func<Vector3> startValue, Func<Vector3> targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			AutoTweenVector3 tween = instance.m_TweenVector3Queue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, tweenType, callback, null, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenVector3Custom(Action<Vector3> updateValue, Vector3 startValue, Vector3 targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenVector3Custom(updateValue, () => startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenVector3Custom(Action<Vector3> updateValue, Func<Vector3> startValue, Vector3 targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenVector3Custom(updateValue, startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenVector3Custom(Action<Vector3> updateValue, Func<Vector3> startValue, Func<Vector3> targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			AutoTweenVector3 tween = instance.m_TweenVector3Queue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, Tween.TweenType.Custom, callback, animationCurve, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenVector4(Action<Vector4> updateValue, Vector4 startValue, Vector4 targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenVector4(updateValue, () => startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenVector4(Action<Vector4> updateValue, Func<Vector4> startValue, Vector4 targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenVector4(updateValue, startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenVector4(Action<Vector4> updateValue, Func<Vector4> startValue, Func<Vector4> targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			AutoTweenVector4 tween = instance.m_TweenVector4Queue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, tweenType, callback, null, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenVector4Custom(Action<Vector4> updateValue, Vector4 startValue, Vector4 targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenVector4Custom(updateValue, () => startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenVector4Custom(Action<Vector4> updateValue, Func<Vector4> startValue, Vector4 targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenVector4Custom(updateValue, startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenVector4Custom(Action<Vector4> updateValue, Func<Vector4> startValue, Func<Vector4> targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			AutoTweenVector4 tween = instance.m_TweenVector4Queue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, Tween.TweenType.Custom, callback, animationCurve, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenColor(Action<Color> updateValue, Color startValue, Color targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenColor(updateValue, () => startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenColor(Action<Color> updateValue, Func<Color> startValue, Color targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			return TweenColor(updateValue, startValue, () => targetValue, duration, delay, callback, scaledTime, tweenType);
		}

		public static int TweenColor(Action<Color> updateValue, Func<Color> startValue, Func<Color> targetValue, float duration, float delay = 0f, Action callback = null, bool scaledTime = false, Tween.TweenType tweenType = Tween.TweenType.EaseOutQuint)
		{
			AutoTweenColor tween = instance.m_TweenColorQueue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, tweenType, callback, null, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}

		public static int TweenColorCustom(Action<Color> updateValue, Color startValue, Color targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenColorCustom(updateValue, () => startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenColorCustom(Action<Color> updateValue, Func<Color> startValue, Color targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			return TweenColorCustom(updateValue, startValue, () => targetValue, duration, animationCurve, delay, callback, scaledTime);
		}

		public static int TweenColorCustom(Action<Color> updateValue, Func<Color> startValue, Func<Color> targetValue, float duration, AnimationCurve animationCurve, float delay = 0f, Action callback = null, bool scaledTime = false)
		{
			AutoTweenColor tween = instance.m_TweenColorQueue.GetTween();
			int tweenIdCount = instance.m_TweenIdCount;
			instance.m_TweenIdCount++;
			tween.Initialize(updateValue, startValue, targetValue, duration, delay, Tween.TweenType.Custom, callback, animationCurve, scaledTime, tweenIdCount);
			instance.m_ActiveTweens.Add(tween);
			return tweenIdCount;
		}
	}
}
